<?php
//定义常量
define('VAN_THEME_DIRECTORY_URI', get_stylesheet_directory_uri());
define('VAN_THEME_OPTIONS', '_van_options');

/**
 * 主题设置初始化
 * @Author   VAN
 * @DateTime 2021-01-16T14:29:56+0800
 * @param    [type]                   $params [description]
 * @return   [type]                           [description]
 */
function van_option_init($params) {
    $theme = wp_get_theme('van');
    if ($theme->exists()) {
        $name    = $theme->get('Name');
        $version = $theme->get('Version');
    }
    $params['framework_title'] = $name.' 主题设置 <small>正式版 V' . $version . '</small>&nbsp;<small><a href="https://www.yfx.top" target="_blank" class="wb-btn">Theme By 源分享</a></small>';
    $params['menu_title']      = $name.'主题设置';
    $params['footer_text']     = '感谢您使用Van主题进行美化，有问题可关注官网 <a href="https://www.yfx.top" target="_blank">www.yfx.top</a>,QQ群:661645679';
    $params['footer_credit'] = '感谢使用VAN进行内容创作，本主题来自<a href="https://www.yfx.top/" target="_blank">WWW.YFX.TOP</a>';
    $params['theme']           = 'light'; //  light OR dark
    $params['show_bar_menu']   = false;
    $params['enqueue_webfont'] = false;
    $params['enqueue']         = false;
    $params['show_search']     = true;
    return $params;
}
add_filter('csf_'.VAN_THEME_OPTIONS.'_args', 'van_option_init');
//获取VAN主题参数
function _van($option = '', $default = null) {
        $options = get_option(VAN_THEME_OPTIONS);
        return (isset($options[$option])) ? $options[$option] : $default;
}
//获取日主题参数
function _caos($option = '', $default = null) {
        $options = get_option('_riprov2_options');
        return (isset($options[$option])) ? $options[$option] : $default;
}